//
//  ThemeManager.m
//  Lightthings
//
//  Created by Hero on 2024/8/30.
//

#import "ThemeManager.h"

@implementation ThemeManager
SingletonM;

- (ThemeEnum)themeValue {
    _themeValue = [[[NSUserDefaults standardUserDefaults] valueForKey:@"themeValue"] intValue];
    if (_themeValue > 1) {
        return _themeValue;
    }
    return 1;
}

- (UIColor *)themeColor {
    switch (self.themeValue) {

        case Theme_Default:
            return jy_HexColor(@"#FFFFFF");
            break;
        case Theme_DarkBlue:
            return jy_HexColor(@"#1B3292");
            break;
        case Theme_Red:
            return jy_HexColor(@"#a00000");
            break;
        case Theme_Purple:
            return jy_HexColor(@"#a897c9");
            break;
        case Theme_Green:
            return jy_HexColor(@"#007e7e");
            break;
        case Theme_Black:
            return jy_HexColor(@"#000000");
            break;
        case Theme_LightBlue:
            return jy_HexColor(@"#206fbc");
            break;
        
    }
    return jy_HexColor(@"#FFFFFF");;
}


- (UIColor *)gradientColor1 {
    switch (self.themeValue) {

        case Theme_Default:
            return jy_HexColor(@"#D9D9D9");
            break;
        case Theme_DarkBlue:
            return jy_HexColor(@"#021E5A");
            break;
        case Theme_Red:
            return jy_HexColor(@"#590000");
            break;
        case Theme_Purple:
            return jy_HexColor(@"#BCAED3");
            break;
        case Theme_Green:
            return jy_HexColor(@"#007E7E");
            break;
        case Theme_Black:
            return jy_HexColor(@"#000000");
            break;
        case Theme_LightBlue:
            return jy_HexColor(@"#216FBC");
            break;
        
    }
    return jy_HexColor(@"#FFFFFF");;
}

- (UIColor *)gradientColor2 {
    switch (self.themeValue) {

        case Theme_Default:
            return jy_HexColor(@"#D9D9D9");
            break;
        case Theme_DarkBlue:
            return jy_HexColor(@"#00338F");
            break;
        case Theme_Red:
            return jy_HexColor(@"#A00000");
            break;
        case Theme_Purple:
            return jy_HexColor(@"#D6CFE5");
            break;
        case Theme_Green:
            return jy_HexColor(@"#00B5AC");
            break;
        case Theme_Black:
            return jy_HexColor(@"#404040");
            break;
        case Theme_LightBlue:
            return jy_HexColor(@"#66AADC");
            break;
        
    }
    return jy_HexColor(@"#FFFFFF");;
}


- (UIColor *)textColor {
    switch (self.themeValue) {

        case Theme_Default:
            return jy_HexColor(@"#041A72");
            break;
        case Theme_DarkBlue:
            return jy_HexColor(@"#FFFFFF");
            break;
        case Theme_Red:
            return jy_HexColor(@"#FFFFFF");
            break;
        case Theme_Purple:
            return jy_HexColor(@"#FFFFFF");
            break;
        case Theme_Green:
            return jy_HexColor(@"#FFFFFF");
            break;
        case Theme_Black:
            return jy_HexColor(@"#FFFFFF");
            break;
        case Theme_LightBlue:
            return jy_HexColor(@"#FFFFFF");
            break;
        
    }
    return jy_HexColor(@"#041A72");;
}


- (NSArray *)gradientColors {
    return @[(id)self.gradientColor1.CGColor, (id)self.gradientColor2.CGColor];
}
- (float)alpha {
    switch (self.themeValue) {

        case Theme_Default:
            return 1.0;
            break;
        case Theme_DarkBlue:
            return 0.2;
            break;
        case Theme_Red:
            return 0.33;
            break;
        case Theme_Purple:
            return 0.44;
            break;
        case Theme_Green:
            return 0.5;
            break;
        case Theme_Black:
            return 0.3;
            break;
        case Theme_LightBlue:
            return 0.2;
            break;
        
    }
    return 1.0;
}

- (UIColor *)circleBackColor {
    switch (self.themeValue) {

        case Theme_Default:
            return jy_HexColor(@"#E5E5E5");
            break;
        case Theme_DarkBlue:
            return jy_HexColor(@"#40A5A1");
            break;
        case Theme_Red:
            return jy_HexColor(@"#853333");
            break;
        case Theme_Purple:
            return jy_HexColor(@"#D0C6E1");
            break;
        case Theme_Green:
            return jy_HexColor(@"#40A5A1");
            break;
        case Theme_Black:
            return jy_HexColor(@"#312F2F");
            break;
        case Theme_LightBlue:
            return jy_HexColor(@"#609CD2");
            break;
        
    }
    return jy_HexColor(@"#E5E5E5");;
}

- (UIColor *)circleFillColor {
    switch (self.themeValue) {

        case Theme_Default:
            return jy_HexColor(@"#041A72");
            break;
        case Theme_DarkBlue:
            return jy_HexColor(@"#FFFFFF");
            break;
        case Theme_Red:
            return jy_HexColor(@"#FFFFFF");
            break;
        case Theme_Purple:
            return jy_HexColor(@"#FFFFFF");
            break;
        case Theme_Green:
            return jy_HexColor(@"#FFFFFF");
            break;
        case Theme_Black:
            return jy_HexColor(@"#FF0000");
            break;
        case Theme_LightBlue:
            return jy_HexColor(@"#FFFFFF");
            break;
        
    }
    return jy_HexColor(@"#041A72");;
}

@end
